﻿using System;
using System.Windows.Input;

namespace Dispatcher.Helpers
{
    /// <summary>
    /// Save event args
    /// </summary>
    public class ExtendedEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ExtendedEventArgs"/> class.
        /// </summary>
        /// <param name="args">The <see cref="System.Windows.Input.ExecutedRoutedEventArgs"/> instance containing the event data.</param>
        public ExtendedEventArgs(ExecutedRoutedEventArgs args)
        {
            Args = args;
        }

        /// <summary>
        /// Gets the args.
        /// </summary>
        public ExecutedRoutedEventArgs Args { get; private set; }

        /// <summary>
        /// Gets a value indicating whether this instance has exception.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance has exception; otherwise, <c>false</c>.
        /// </value>
        public bool HasException { get { return Exception != null; } }

        /// <summary>
        /// Gets or sets the exception.
        /// </summary>
        /// <value>
        /// The exception.
        /// </value>
        public Exception Exception { get; set; }
    }
}
